package com.cq.service.impl;

import com.cq.mapper.BannerMapper;
import com.cq.pojo.Banner;
import com.cq.service.BannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: 悠久的苍穹
 * @Date: 2021/1/20 15:56
 * @Description: ${description}
 * @Version: 1.0
 */
@Service
public class BannerServiceImpl implements BannerService {

    @Autowired
    BannerMapper bannerMapper;

    @Override
    public List<Banner> findAllBanner() {
        return bannerMapper.findAllBanner();
    }

    @Override
    public List<Banner> findBanners(int page, int limit) {
        return bannerMapper.findBanners((page-1)*limit,limit);
    }

    @Override
    public int getCount() {
        return bannerMapper.getCount();
    }

    @Override
    public Banner findBannerById(int id) {
        return bannerMapper.findBannerById(id);
    }

    @Override
    public int updateBanner(Banner banner) {
        return bannerMapper.updateBanner(banner);
    }

    @Override
    public List<Banner> findAllBannerIshow() {
        return bannerMapper.findAllBannerIshow();
    }

    @Override
    public int addBanner(Banner banner) {
        return bannerMapper.addBanner(banner);
    }

    @Override
    public void deleteBannerById(int id) {
        bannerMapper.deleteBannerById(id);
    }
}
